package com.jsql.model.accessible;

import java.util.Arrays;
import java.util.Optional;

public enum ExploitMode {
    AUTO("MODE_AUTO", "MODE_AUTO_TOOLTIP"),
    QUERY_BODY("MODE_QUERY_BODY", "MODE_QUERY_BODY_TOOLTIP"),
    TEMP_TABLE("MODE_TEMP_TABLE", "MODE_TEMP_TABLE_TOOLTIP"),
    NETSHARE("MODE_NETSHARE", "MODE_NETSHARE_TOOLTIP");
    private final String keyLabel;
    private final String keyTooltip;
    ExploitMode(String keyLabel, String keyTooltip) {
        this.keyLabel = keyLabel;
        this.keyTooltip = keyTooltip;
    }
    public static Optional<ExploitMode> forName(String label) {  // used with toString() giving enum name
        return Arrays.stream(ExploitMode.values())
        .filter(action -> label.equals(action.name()))
        .findFirst();
    }

    public String getKeyLabel() {
        return this.keyLabel;
    }

    public String getKeyTooltip() {
        return this.keyTooltip;
    }
}